package com.springproject.forum.exception;

import com.springproject.forum.common.AppResult;

/**
 * 自定义异常
 */

public class ApplicatonException extends RuntimeException{

    //在异常中持有一个错误信息对象

    protected AppResult errorResult;

    public ApplicatonException(AppResult errorResult){
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public AppResult getErrorResult() {
        return errorResult;
    }

    public ApplicatonException(String message) {
        super(message);
    }

    public ApplicatonException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicatonException(Throwable cause) {
        super(cause);
    }
}
